<!--
 * @Author: 唐锋
 * @Date: 2019-06-14 16:34:06
 * @Description: 登录页面
 -->
 <template>
  <div class="login">
    登录页面
    <el-button type="primary"
      @click="login">跳转</el-button>
  </div>
</template>
 
 <script>
import axios from "axios";
export default {
  components: {},
  props: {},
  data() {
    return {};
  },
  watch: {},
  computed: {},
  methods: {
    /**
     * @description: 登录跳转
     * @param  [account password]
     *
     */
    login() {
      axios
        .post("http://118.190.205.4:8089/admin/user/login", {
          account: "admin",
          password: 123456
        })
        .then(res => {
           console.log(res)
          if (!res.data.errCode) {
            this.$router.push("/index/order");
            const token = res.data.adminToken.token;
            sessionStorage.setItem("initActive", "1.1");
            sessionStorage.setItem("token", token);
           
          }
        });
    }
  },
  created() {},
  mounted() {}
};
</script>
 <style lang="scss" scoped>
.login {
}
</style>
